import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import ElementPlus from 'element-plus'
import { createPinia } from "pinia";
import 'element-plus/dist/index.css'
// 导入router
import router from "./router";



//TypeScript注册
// 由于必须要拓展ComponentCustomProperties类型才能获得类型提示
declare module "vue" {
    export interface ComponentCustomProperties {
        $http: any
    }
}

import api from './api/request'
const app = createApp(App)
const store = createPinia()
// 自定义全局指令
app.directive('color',{
    created(el){
        // console.log(el,'el');
        el.style.color='red'
    },
})
// 挂载element
app.use(ElementPlus)
app.use(api)
app.use(router)
app.use(store)
app.mount('#app')
